#coding=utf8
'''
Created on 2016��6��11��

@author: weizhijie
'''

import os
import json
import time
import sys

class DataNodeForBusy:
    
    def __init__(self,timestamp, cpu_all_percent,memory_percent,disk_read_speed,disk_write_speed,net_send_speed,net_rec_speed):
        self.cpu_all_percent=cpu_all_percent
        self.memory_percent=memory_percent
        self.disk_read_speed=disk_read_speed
        self.disk_write_speed=disk_write_speed
        self.net_send_speed=net_send_speed
        self.net_rec_speed=net_rec_speed
        self.timestamp=timestamp
        self.outlier=((self.disk_read_speed+self.disk_write_speed+self.net_rec_speed+self.net_send_speed)*1.0)/(self.cpu_all_percent+0.00001)
        self.busy=((self.disk_read_speed+self.disk_write_speed+self.net_rec_speed+self.net_send_speed)*1.0)+(self.cpu_all_percent+0.00001)
    def __lt__(self, other):  
         return self.busy > other.busy
